<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProtocolSetTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('protocol_set', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name',40)->default('')->comment('协议名称');
            $table->integer('street_id')->default(0)->comment('街道id');
            $table->integer('project_id')->default(0)->comment('项目id');
            $table->integer('village_id')->default(0)->comment('村庄id');
            $table->integer('segment_id')->default(0)->comment('号段id');
            $table->integer('supply_form')->default(0)->comment('补偿形式');
            $table->integer('build_form')->default(0)->comment('建筑形式');
            $table->decimal('upper_lean', 10, 2)->default(0)->comment('上靠');
            $table->decimal('lower_lean', 10, 2)->default(0)->comment('下靠');
            $table->decimal('reward_area', 10, 2)->default(0)->comment('奖励面积');
            $table->decimal('subsidy_fee', 10, 2)->default(0)->comment('搬迁补助费');
            $table->date('transition_start_time')->comment('临时过渡费开始时间');
            $table->date('transition_end_time')->comment('临时过渡费结束时间');
            $table->decimal('reward_transition_price', 10, 2)->default(0)->comment('临时过渡费月奖励单价');
            $table->decimal('transition_price', 10, 2)->default(0)->comment('临时过渡费月单价');
            $table->integer('transition_month')->default(0)->comment('临时过渡费补助月份');
            $table->date('require_sign_start_time')->comment('规定时间签约奖励开始时间');
            $table->date('require_sign_end_time')->comment('规定时间签约奖励结束时间');
            $table->decimal('require_sign_fee', 10, 2)->default(0)->comment('规定时间签约奖励费用');
            $table->date('require_clear_start_time')->comment('规定时间腾房奖励开始时间');
            $table->date('require_clear_end_time')->comment('规定时间腾房奖励结束时间');
            $table->decimal('require_clear_fee', 10, 2)->default(0)->comment('规定时间腾房奖励费用');
            $table->decimal('decorate_price', 10, 2)->default(0)->comment('简单装修单价');
            $table->decimal('no_decorate_price', 10, 2)->default(0)->comment('不简单装修单价');
            $table->decimal('stop_price', 10, 2)->default(0)->comment('停产停业单价');
            $table->integer('stop_month')->default(0)->comment('停产停业补助月份');
            $table->decimal('improve_area', 10, 2)->default(0)->comment('改善面积');
            $table->decimal('money_price', 10, 2)->default(0)->comment('货币补偿的单价');
            $table->decimal('othe_build_price', 10, 2)->default(0)->comment('院落用地及附属物、构筑物补助费单价');
            $table->decimal('public_area_scale', 10, 2)->default(0)->comment('公摊面积比例');
            $table->integer('require_clear_time')->default(0)->comment('规定腾房期限');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `protocol_set` comment '协议配置表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('protocol_set');
    }
}
